﻿using Project3D.my3D.Geometric;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Project3D.my3D.Base
{
    public class Matrix4
    {
        public double[,] matrix;

        public Matrix4()
        {
            this.matrix = new double[4, 4];
        }

        public static Matrix4 MakeSum(List<Matrix4> list)
        {
            Matrix4 m = new Matrix4();

            foreach (Matrix4 _m in list)
                for (int i = 0; i < 4; i++)
                    for (int j = 0; j < 4; j++)
                        m.matrix[i, j] += _m.matrix[i, j];

            return m;
        }

        public static Matrix4 operator +(Matrix4 u, Matrix4 v)
        {
            Matrix4 m = new Matrix4();

            for (int i = 0; i < 4; i++)
                for (int j = 0; j < 4; j++)
                    m.matrix[i, j] = u.matrix[i, j] + v.matrix[i, j];

            return m;
        }

    }
}
